package com.apartment.own.service.impl;

import java.util.List;
import com.apartment.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.apartment.own.mapper.OwnOrdPaymentTierMapper;
import com.apartment.own.domain.OwnOrdPaymentTier;
import com.apartment.own.service.IOwnOrdPaymentTierService;

/**
 * 付款分阶Service业务层处理
 * 
 * @author @Dog_E
 * @date 2020-08-28
 */
@Service
public class OwnOrdPaymentTierServiceImpl implements IOwnOrdPaymentTierService 
{
    @Autowired
    private OwnOrdPaymentTierMapper ownOrdPaymentTierMapper;

    /**
     * 查询付款分阶
     * 
     * @param id 付款分阶ID
     * @return 付款分阶
     */
    @Override
    public OwnOrdPaymentTier selectOwnOrdPaymentTierById(Long id)
    {
        return ownOrdPaymentTierMapper.selectOwnOrdPaymentTierById(id);
    }

    /**
     * 查询付款分阶列表
     * 
     * @param ownOrdPaymentTier 付款分阶
     * @return 付款分阶
     */
    @Override
    public List<OwnOrdPaymentTier> selectOwnOrdPaymentTierList(OwnOrdPaymentTier ownOrdPaymentTier)
    {
        return ownOrdPaymentTierMapper.selectOwnOrdPaymentTierList(ownOrdPaymentTier);
    }

    /**
     * 新增付款分阶
     * 
     * @param ownOrdPaymentTier 付款分阶
     * @return 结果
     */
    @Override
    public int insertOwnOrdPaymentTier(OwnOrdPaymentTier ownOrdPaymentTier)
    {
        ownOrdPaymentTier.setCreateTime(DateUtils.getNowDate());
        return ownOrdPaymentTierMapper.insertOwnOrdPaymentTier(ownOrdPaymentTier);
    }

    /**
     * 修改付款分阶
     * 
     * @param ownOrdPaymentTier 付款分阶
     * @return 结果
     */
    @Override
    public int updateOwnOrdPaymentTier(OwnOrdPaymentTier ownOrdPaymentTier)
    {
        ownOrdPaymentTier.setUpdateTime(DateUtils.getNowDate());
        return ownOrdPaymentTierMapper.updateOwnOrdPaymentTier(ownOrdPaymentTier);
    }

    /**
     * 批量删除付款分阶
     * 
     * @param ids 需要删除的付款分阶ID
     * @return 结果
     */
    @Override
    public int deleteOwnOrdPaymentTierByIds(Long[] ids)
    {
        return ownOrdPaymentTierMapper.deleteOwnOrdPaymentTierByIds(ids);
    }

    /**
     * 删除付款分阶信息
     * 
     * @param id 付款分阶ID
     * @return 结果
     */
    @Override
    public int deleteOwnOrdPaymentTierById(Long id)
    {
        return ownOrdPaymentTierMapper.deleteOwnOrdPaymentTierById(id);
    }
}
